//    Copyright (C) Kherty.  All rights reserved.
using System;
using OpenLS.Spreadsheet.Extensibility;

namespace OpenLS.Spreadsheet.Expressions
{
    internal class CellError : ICellEnumerator, ICell
    {
        private readonly Error _error;

        public CellError(Error error)
        {
            _error = error;
        }

        public object Value
        {
            get { throw new ErrorException(_error); }
        }

        public IWorksheet Worksheet
        {
            get { throw new ErrorException(_error); }
        }

        public IRange ToRange()
        {
            throw new ErrorException(_error);
        }

        public bool ContainsFunction(string p)
        {
            throw new ErrorException(_error);
        }

        public object Info(string info_type)
        {
            throw new ErrorException(_error);
        }

        public int ColumnIndex
        {
            get { throw new ErrorException(_error); }
        }

        public int RowIndex
        {
            get { throw new ErrorException(_error); }
        }
    }
}